<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head th:include="cultivateWeb/header :: culHeaderCss">
</head>
<link href="../static/css/bootstrap.min.css" rel="stylesheet">
<link type="text/css" href="/css/cultivateWeb/style/my.css" rel="stylesheet">
<link type="text/css" href="/css/cultivateWeb/style/course.css" rel="stylesheet">
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">
<body>
<!-- 顶部导航 -->
<header th:include="cultivateWeb/header :: header"></header>
<style>
    .myTitle {
        width: 155px;
        height: 55px;
        text-align: center;
        display: inline-block;
        font-size: 22px;
        line-height: 55px;
        border-bottom: 2px #005C34 solid;
        margin-left: 11px;
        color: #005C34;
    }


</style>
<div style="clear: both"></div>
<div style="background-color: #f7f7f7; ">
    <div class="container">
        <div class="row">
    <div class="layui-container">
        <p style="line-height: 40px">当前位置：<a href="/cultivate/homepage">首页</a> > 我的课程</p>
    </div>
    <hr style="margin: 0 auto ;"/>
    <section style="display:flex;background:#F7F7F7;padding-top: 0">
        <div class="col-xs-3" style="height: 850px;padding:0;margin-right:10px;background-color: #fff">
            <ul id="personal_data">
                <li><a href="/cultivate/my">个人资料</a></li>
                <li><a href="/cultivate/myOrder">我的订单</a></li>
                <li ><a href="/cultivate/myClasss/myClasss">我的班级</a></li>
                <li ><a href="/cultivate/myCourse">我的课程</a></li>
                <li class="this"><a href="/cultivate/myCoursePlan">我的课程计划</a></li>
                <li><a href="/cultivate/studyRecord">学习记录</a></li>
                <li onclick="recruit()"><a>我的简历</a></li>
                <li><a href="/cultivate/deliverRecord">投递记录</a></li>
                <li><a href="/cultivate/applyRecord">申请记录</a></li>
                <li><a href="/cultivate/myMessage">消息中心</a></li>
                <li><a href="/cultivate/myCertificates">我的证书</a></li>
                <li onclick="mock2(this)" data-type="2"><a>幼儿照护初级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="1"><a>幼儿照护中级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="0"><a>幼儿照护高级模拟考试</a></li>
            </ul>
        </div>
        <div class="col-xs-9" style="padding:0;background-color: #fff">
            <div class="bt50">
                <div class="rmtjkc aa">
                    <div class="xianshi">
                        <div class="qiehuan active">
                            <ul class="clear" id="course">
                            </ul>
                        </div>
                        <div id="page" class="page"></div>
                    </div>
                </div>
            </div>
        </div>
        <div style="clear: both"></div>
    </section>
        </div>
    </div>
    <!-- 分页 -->
</div>
<!-- footer ------------------------------------------------------- -->
<div class="footer" th:include="cultivateWeb/header :: footer"></div>
<script type="text/javascript" src="/js/xlPaging.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/mobile.js"></script>
</body>
<style>
    .bg-black{
        width: 100%;
        height: 100%;
        background: #ffffff;
        opacity: 0.1;
        color: #fff;
        position: absolute;
        z-index: 99;
        left: 0;
        top: 0;

    }
</style>
<script>
    $(function () {
        var is_mobi = navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;

        if(is_mobi){
            $("#course li").css("width:100%")
            $("#personal_data").find('li').eq(9).hide();
            $("#personal_data").find('li').eq(10).hide();
            $("#personal_data").find('li').eq(11).hide();

        }
        //课程数据
        getCourse()
    });

    function getCourse() {
        ajaxToken("/jzApi/courses/selMyCoursePlanList", 'GET',
            {
                current: 1,
                number: 16
            }, function (res) {
                if (res.pages == 0) {
                    $("#course").html('<div class="noData">暂无数据</div>');
                } else {
                    var list = res.records;
                    var course = '';
                    list.forEach(function (item, index) {
                        var b = '';
                        if (res.type == 0) {
                            b = '<span style="color: #FF9500">(证书课程)</span>'
                        } else if(res.type == 1){
                            b = '<span style="color: #569175">(师资培训课程)</span>'
                        } else if(res.type == 2){
                            b = '<span style="color: #569175">(考评员培训课程)</span>'
                        } else if(res.type == 3){
                            b = '<span style="color: #569175">(高级师资培训课程)</span>'
                        } else if(res.type == 4){
                            b = '<span style="color: #569175">(高级考评员培训课程)</span>'
                        }
                        course += '<li>' +
                            '<div style="position: relative">' +
                            '<img class="bg-img" src="' + item.thumbnail + '" alt="图片">' +
                            '<div class="bg-black"></div></div>' +
                            '<div style="padding: 10px">' +
                            '<h1 style="text-align: left;margin-bottom: 10px" >' + item.courseName + b + '</h1>' +
                            '   <h2 style="text-align: right">' +
                            '       <span style="color: #666">讲师：' + item.teacherName + '</span>' +
                            '   </h2>' +
                            '</div>' +
                            '<div style="margin-top: 10px">' +
                            '<a style="float: left;" href="/couInfo/coursePlan?id=' + item.coursesId + '&classId='+item.classId+'" class="uc-ykt-course-card_btn">查看课程计划</a>' +
                            '<div style="clear: both"></div></div>' +
                            '</li>'
                    });
                    course += '<div style="clear: both"></div>';
                    $("#course").html(course);
                    page(1, res.pages);
                }
            }
        )
    }

    function page(num, tolPages, state) {
        $("#page").paging({
            nowPage: Number(num), // 当前页码
            pageNum: Number(tolPages), // 总页码
            buttonNum: 10, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 1,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                ajaxToken("/jzApi/courses/selMyCoursePlanList", 'GET',
                    {
                        state: state,
                        current: 1,
                        number: 16
                    }, function (res) {
                        if (res.pages == 0) {
                            $("#course").html('<div class="noData">暂无数据</div>');
                        } else {
                            var list = res.records;
                            var course = '';
                            list.forEach(function (item, index) {
                                var b = '';
                                if (res.type == 0) {
                                    b = '<span style="color: #FF9500">(证书课程)</span>'
                                } else if(res.type == 1){
                                    b = '<span style="color: #569175">(师资培训课程)</span>'
                                } else if(res.type == 2){
                                    b = '<span style="color: #569175">(考评员培训课程)</span>'
                                } else if(res.type == 3){
                                    b = '<span style="color: #569175">(高级师资培训课程)</span>'
                                } else if(res.type == 4){
                                    b = '<span style="color: #569175">(高级考评员培训课程)</span>'
                                }
                                course += '<li>' +
                                    '<div style="position: relative">' +
                                    '<img class="bg-img" src="' + item.thumbnail + '" alt="图片"><div class="bg-black"></div><div class="bg-text">已完成：' + item.process + '</div></div>' +
                                    '<div style="padding: 10px">' +
                                    '<h1 style="text-align: left;margin-bottom: 10px">' + item.name + b + '</h1>' +
                                    '   <h2 style="text-align: right">' +
                                    '       <span style="color: #666">讲师：' + item.teacherName + '</span>' +
                                    '   </h2>' +
                                    '</div>' +
                                    '<div style="margin-top: 10px"><a style="float: left;" class="uc-ykt-course-card_btn">开始学习</a>' +
                                    '<a style="float: right;" class="uc-ykt-course-card_btn">答题解析</a><div style="clear: both"></div></div>' +
                                    '</li>'
                            });
                            $("#course").html(course);
                        }
                    }
                )
            }
        });
    }

</script>
</html>